<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mmw_controller_Request
 *
 * @author Manu
 */
require_once(dirname(__FILE__)."/../core/mmw_core_RequestRegistry.php");

class mmw_controller_Request {
    private $properties;
    private $feedback=array();
    private $success=false;
    private $result;
    
    public function __construct() {
        $this->init();
        mmw_core_RequestRegistry::setRequest($this);
    }
    
    private function init() {
        if (isset($_SERVER['REQUEST_METHOD'])) {
            $this->properties=$_REQUEST;            
        }
    }
    
    public function getProperty($key) {
        if (isset($this->properties[$key])) {
            return $this->properties[$key];
        }
        return null;
    }
    
    public function setProperty($key, $value) {
        $this->properties[$key]=$value;
    }
    
    public function addFeedback($msg) {
        array_push($this->feedback, $msg);
    }
    
    public function getFeedback() {
        return $this->feedback;
    } 
    
    public function setSuccess($success) {
        $this->success=$success;
    }
    
    public function isSuccess() {
        return $this->success;
    }
    
    public function setResults($results) {
        $this->result=$results;
    }
    
    public function getResults() {
        return $this->result;
    }
}

?>
